/*
 * Created on 2004-12-6
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package com.tss.util;

import java.util.Date;

/**
 * @author Administrator
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class Log {
	private static Log log = null;
	private static Object logLock = new Object();
	
	public Log() {}
	
	public static void trace(String traceMsg){
		if (log == null) {
			synchronized(logLock) {
				if (log == null) {
					log = new Log();
				}
			}
		}
		log.printTrace(traceMsg);
	}
	
	protected void printTrace(Object msg){
		String strFalgTrace = PropertyManager.getProperty("System.TraceFlag");
		if (strFalgTrace == null || !strFalgTrace.equalsIgnoreCase("true")){
			return;
		}
		System.out.println("timestamp:" + new Date());
		System.out.println("trace    :"+msg);
	}
}
